// sku 接口
import request from '@/utils/request'
import type { SkuResponseData, SkuInfoData } from './type'
 enum API {
  // 获取已有商品数据
  SKU_URL = '/admin/product/list/',
  // 下架sku
  CANCELSALE_URL = '/admin/product/cancelSale/',
  // 上架sku
  SALE_URL = '/admin/product/onSale/',
  // 获取sku详情
  SKUINFO_URL = '/admin/product/getSkuInfo/',
  // 删除sku
  REMOVESKU_URL = '/admin/product/deleteSku/'
 }



// 获取商品sku接口
export const reqSkuList = (page:number, limit: number) => request.get<any, SkuResponseData>(API.SKU_URL+`${page}/${limit}`) 

// 上架sku接口
export const reqSaleSku = (skuId:number) => request.get<any, any>(API.SALE_URL+`${skuId}`)

// 下架sku
export const reqCanelSale = (skuId:number) => request.get<any, any>(API.CANCELSALE_URL+`${skuId}`)

// 获取sku详情
export const reqSkuInfo = (skuId: number) => request.get<any,SkuInfoData>(API.SKUINFO_URL+`${skuId}`)

// 删除sku
export const reqRemoveSku = (skuId: number) => request.delete<any,any>(API.REMOVESKU_URL+`${skuId}`)
